<!--
 * @Author: yuqy
 * @Date: 2022-11-09 15:53:04
 * @LastEditors: yuqy
 * @LastEditTime: 2023-10-19 16:42:09
 * @Descripttion: -
-->
<template>
  <div class="svg_wrap">
      <!-- 
        M = moveto(M X,Y) ：将画笔移动到指定的坐标位置
        L = lineto(L X,Y) ：画直线到指定的坐标位置
        H = horizontal lineto(H X)：画水平线到指定的X坐标位置
        V = vertical lineto(V Y)：画垂直线到指定的Y坐标位置
        C = curveto(C X1,Y1,X2,Y2,ENDX,ENDY)：三次贝赛曲线
        S = smooth curveto(S X2,Y2,ENDX,ENDY)
        Q = quadratic Belzier curve(Q X,Y,ENDX,ENDY)：二次贝赛曲线
        T = smooth quadratic Belzier curveto(T ENDX,ENDY)：映射
        A = elliptical Arc(A RX,RY,XROTATION,FLAG1,FLAG2,X,Y)：弧线
        Z = closepath()：关闭路径
       -->
    <svg t="1667978552121" class="icon" viewBox="0 0 1794 1624" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7204" data-spm-anchor-id="a313x.7781069.0.i12" width="128" height="128">
        <path d="M0 1500l188.631579 0 0 124-188.631579 0 0-296.421053Z" p-id="7205" data-spm-anchor-id="a313x.7781069.0.i6" class="" :fill="setFillColor(1)"></path>
        <path d="M269.473684 1200l188.631579 0 0 424-188.631579 0 0-458.105263Z" p-id="7206" data-spm-anchor-id="a313x.7781069.0.i7" class="" :fill="setFillColor(2)"></path>
        <path d="M565.894737 900l188.631579 0 0 724-188.631579 0 0-646.736842Z" p-id="7207" data-spm-anchor-id="a313x.7781069.0.i8" class="" :fill="setFillColor(3)"></path>
        <path d="M860 600l188.631579 0 0 1024-188.631579 0 0-860Z" p-id="7208" data-spm-anchor-id="a313x.7781069.0.i9" class="" :fill="setFillColor(4)"></path>
        <path d="M1200 300l188.631579 0 0 1324-188.631579 0 0-1200Z" p-id="7209" data-spm-anchor-id="a313x.7781069.0.i10" class="" :fill="setFillColor(5)"></path>
        <path d="M1524 0l188.631579 0 0 1624-188.631579 0 0-1524Z" p-id="7220" data-spm-anchor-id="a313x.7781069.0.i6" class="" :fill="setFillColor(6)"></path>
    </svg>
  </div>
</template>
<script>
/* eslint-disable */ 
export default {
  name: "SVG_",
  props: {
    level: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
        fillColor: '#515151', // 默认填充色
        activeFillColor: '#1afa29',
        fillErrorColor: 'red'
    }
  },
  mounted() {
  },
  created () {
  },
  destroyed() {

  },
  methods: {
    setFillColor (num) {
        switch (this.level * 1) {
            case 0:
                return this.fillColor
                break;
            case 1: // 网络信号最好
                return this.activeFillColor
                break;
            case 2: 
                if (num <= 5) {
                    return this.activeFillColor
                } else {
                   return this.fillColor 
                }
                break;
            case 3: 
                if (num <= 4) {
                    return this.activeFillColor
                } else {
                   return this.fillColor 
                }
                break;
            case 4: 
                if (num <= 3) {
                    return this.activeFillColor
                } else {
                   return this.fillColor 
                }
                break;
            case 5: 
                if (num <= 2) {
                    return this.activeFillColor
                } else {
                   return this.fillColor 
                }
                break;
            case 6: 
                if (num <= 1) {
                    return this.activeFillColor
                } else {
                   return this.fillColor 
                }
                break;
            default:
                return this.fillErrorColor 
                break;
        }
    },
    getFastBoardGainToken() {
    },
    /**
     * @name: 控制书写
     * @msg:
     * @return {*}
     */
    controlWrite() {

    },
    /**
     * @name: 创建画板
     * @msg: 
     * @param {*} data
     * @param {*} div
     * @return {*}
     */    
    async mountFastboard (data, div) {
     
    }
  }
}
</script>

<style lang="less" scoped >
.svg_wrap {
    vertical-align: baseline;
    width: 14px;
    height: 14px;
    min-width: 14px;
    display: inline-block;
    svg{
        width: 100%;
        height: 100%;
    }
}
</style>
